
#ifndef VEC3F_H
#define VEC3F_H

#include <math.h>
#include <cstdlib>
#include <iostream>

using namespace std;

#define PI			3.14159265f
#define	TWO_PI		6.28318530f
#define	HALF_PI		1.57079633f

class Vec3f { 

	public: 

		float x, y, z;
		
		static const int Random = 1;

		// Constructors
		Vec3f();
		Vec3f(float px, float py, float pz);
		Vec3f(float xyz[3]);
		Vec3f(const Vec3f& v);
		Vec3f(int type);

		// Operator Overloads
		Vec3f operator+=(const Vec3f& addend);
		Vec3f operator-=(const Vec3f& subtrahend);
		Vec3f operator*=(const Vec3f& scalar);
		Vec3f operator/=(const Vec3f& divisor);
		Vec3f operator*=(float scalar);
		Vec3f operator/=(float divisor);
		Vec3f operator=(const Vec3f& v);
		bool  operator==(const Vec3f& v) const;
		Vec3f operator+(const Vec3f& addend) const;
		Vec3f operator-(const Vec3f& subtrahend) const;
		Vec3f operator-() const;
		float operator*(const Vec3f& dotOperand) const;
		Vec3f operator*(float scalar) const;
		Vec3f operator/(float divisor) const;
		float operator[](int index) const;
		//ostream& operator<<(ostream& os) const;

		// Utility Functions
		float mag() const;
		float length() const;
		Vec3f normalized() const;
		Vec3f crossedWith(const Vec3f& v) const;
		const float* getArray() const;
		void print() const;

		// Alteration functions
		void normalize();
		void normalizeAtLength(float currLength);
		void normalizeToLength(float newLength);
		void randomize();
		Vec3f multiplyBy4x4Matrix(const float* m);	

};

#endif
